function[] = mahalanobisValidation()

    disp('MAHALANOBIS DISTANCE CLASSIFICATION');
    wines = loadWines('../Wine/wine.data');
    F = dir('FeatureCombinationDefs/*.txt');
    for featureFilter = 1 : size(F, 1)
        featureFilteredWines = filterFeatures(wines, ['FeatureCombinationDefs/' F(featureFilter).name]);
        disp(['Feature combination according to file [' F(featureFilter).name ']']);
        D = dir('TrainingSetDefs/*.txt');
        for split = 1 : size(D, 1)
            [trainingSet, testSet] = splitIntoTrainingAndTest(featureFilteredWines, ['TrainingSetDefs/' D(split).name]);
            correct = 0;
            [meanVecs, varVec] = trainForMahalanobis(trainingSet);
            for i = 1 : size(testSet, 2)
                result = mahalanobisClassification(testSet(2:size(testSet,1), i), meanVecs, varVec);
                if result == testSet(1, i)
                    correct = correct + 1;
                end
            end
            disp(['  Training/Test separation [' D(split).name ']: ' num2str(correct) '/' num2str(size(testSet, 2))]);
        end
    end
end
